serverless.yml トラブルシューティング 「Cannot create property "events"」
Cannot create property 'events' on string '${file(functions/foo/s-function.json)}'みたいなERRORが出た時の対処法
原因
functionsプロパティのリソースのファイル分けを適切に行えてない
OKな例
code: severless.yml
functions:
sampleFunction: ${file(functions/foo/s-function.yml):sampleFunction}
code: s-functions.yml
sampleFunction:
handler: ./resources/lambda/check_glue_running_time/functions/check_glue_endpoint.lambda_handler
name: auto-function-check
memorySize: 256
timeout: 900
runtime: python3.8
role: MyRole
events:
- schedule: cron(*/10 * * * ? *)
NGな例
上のOK例以外